<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Db</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> Db</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Connect with and communicate with the database</p>
	<ul class="tags">
				<li><span class="field">author:</span> Paul Wilkins &lt;<a href="mailto:paul@amemorytree.co.nz">paul@amemorytree.co.nz</a>&gt;</li>
				<li><span class="field">version:</span> 1.0</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_db.php.html">/db.php</a> (line <span class="field">9</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">resource</span>
										<a href="#connect" title="details" class="method-name">connect</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$server</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$pass</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#escape" title="details" class="method-name">escape</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">array</span>
										<a href="#fetch" title="details" class="method-name">fetch</a>
											(<span class="var-type">resource</span>&nbsp;<span class="var-name">$result</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">array</span>
										<a href="#fetchRow" title="details" class="method-name">fetchRow</a>
											(<span class="var-type">resource</span>&nbsp;<span class="var-name">$result</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">bool</span>
										<a href="#free" title="details" class="method-name">free</a>
											(<span class="var-type">resource</span>&nbsp;<span class="var-name">$result</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">resource</span>
										<a href="#query" title="details" class="method-name">query</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">int</span>
										<a href="#rowCount" title="details" class="method-name">rowCount</a>
											(<span class="var-type">resource</span>&nbsp;<span class="var-name">$result</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#select" title="details" class="method-name">select</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$database</span>)
									</div>
											</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
													<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodconnect" id="connect"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">connect</span> (line <span class="line-number">25</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Connect to the database server</p>
	<ul class="tags">
				<li><span class="field">return:</span> Link identifier on success, or FALSE on failure</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">resource</span>
		<span class="method-name">
			connect
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$server</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$pass</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$server</span><span class="var-description">: Path to the server</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: The username</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$pass</span><span class="var-description">: The password</span>			</li>
				</ul>
		
			
	</div>
<a name="methodescape" id="escape"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">escape</span> (line <span class="line-number">54</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Convert values so they are safe being used in an SQL string</p>
	<ul class="tags">
				<li><span class="field">return:</span> The escaped value, or FALSE on error</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			escape
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$value</span><span class="var-description">: The value to be escaped</span>			</li>
				</ul>
		
			
	</div>
<a name="methodfetch" id="fetch"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">fetch</span> (line <span class="line-number">91</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Fetch a result row as an associative array</p>
	<ul class="tags">
				<li><span class="field">return:</span> An associative array of strings, or FALSE on failure</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			fetch
		</span>
					(<span class="var-type">resource</span>&nbsp;<span class="var-name">$result</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">resource</span>
				<span class="var-name">$result</span><span class="var-description">: The result resource that's being evaluated</span>			</li>
				</ul>
		
			
	</div>
<a name="methodfetchRow" id="fetchRow"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">fetchRow</span> (line <span class="line-number">102</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Fetch a result row as a numerical array</p>
	<ul class="tags">
				<li><span class="field">return:</span> A numerical array of strings, or FALSE if no more rows</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			fetchRow
		</span>
					(<span class="var-type">resource</span>&nbsp;<span class="var-name">$result</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">resource</span>
				<span class="var-name">$result</span><span class="var-description">: The result resource that's being evaluated</span>			</li>
				</ul>
		
			
	</div>
<a name="methodfree" id="free"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">free</span> (line <span class="line-number">113</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Free all memory associated with the result</p>
	<ul class="tags">
				<li><span class="field">return:</span> TRUE on success, or FALSE on failure</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			free
		</span>
					(<span class="var-type">resource</span>&nbsp;<span class="var-name">$result</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">resource</span>
				<span class="var-name">$result</span><span class="var-description">: The result resource that's being evaluated</span>			</li>
				</ul>
		
			
	</div>
<a name="methodquery" id="query"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">query</span> (line <span class="line-number">65</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Send a unique query to the database</p>
	<ul class="tags">
				<li><span class="field">return:</span> Either a resultset or true/false depending on the type of query</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">resource</span>
		<span class="method-name">
			query
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$sql</span><span class="var-description">: The SQL query to be sent to the database</span>			</li>
				</ul>
		
			
	</div>
<a name="methodrowCount" id="rowCount"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">rowCount</span> (line <span class="line-number">80</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the number of rows in the result</p>
	<ul class="tags">
				<li><span class="field">return:</span> The number of rows in the result set, or FALSE on failure</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			rowCount
		</span>
					(<span class="var-type">resource</span>&nbsp;<span class="var-name">$result</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">resource</span>
				<span class="var-name">$result</span><span class="var-description">: The result resource that's being evaluated</span>			</li>
				</ul>
		
			
	</div>
<a name="methodselect" id="select"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">select</span> (line <span class="line-number">40</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Select a database from the server</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			select
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$database</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$database</span><span class="var-description">: The name of the database to be selected</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Thu, 18 Jun 2009 14:07:58 +1200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
	</p>
	</div></body>
</html>